from app.core.conf import ST
from app.tornado.limit import Tornado
from loguru import logger

batteryTornado = Tornado("battery", 3 , 10 * 60)

bat_lev_low = 0.40


def handle_battery_charge(all1,ip):
    global bat_lev_low
    battery_level =all1.get('battery_level')
    charging = all1.get('charging')
    logger.debug(charging);
    if battery_level < bat_lev_low:
        logger.warning(f"IP:{ip} 电量小于<{bat_lev_low}");
        batteryTornado.send(f"IP:{ip} 电量小于<{bat_lev_low}")
        return


    

    